package com.guoxin.part4.chapter23;

/**
 * @author guoxin
 * @date 2019/9/2
 */
public class CountDownLatchTest {
    public static void main(String[] args) throws InterruptedException {
        Latch latch = new CountDownLatch(4);
        new ProgrammerTravel(latch, "Alex", "Bus").start();
        new ProgrammerTravel(latch, "Gavin", "Walking").start();
        new ProgrammerTravel(latch, "Jack", "Subway").start();
        new ProgrammerTravel(latch, "Dillon", "Bicycle").start();
        latch.await();
        System.out.println("== all of programmer arrived ==");
    }
}
